home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
walpeep
/
wallpeep.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
13KB
|
484 lines
VERSION 2.00
Begin Form Form1
BorderStyle = 3 'Fixed Double
Caption = "WallPeeper"
ClientHeight = 3960
ClientLeft = 105
ClientTop = 690
ClientWidth = 4455
FillColor = &H00010000&
ForeColor = &H00808080&
Height = 4650
Icon = WALLPEEP.FRX:0000
Left = 45
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 264
ScaleMode = 3 'Pixel
ScaleWidth = 297
Top = 60
Width = 4575
Begin CheckBox ShowAllFiles
Caption = "Show all usable files on C"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 75
TabIndex = 13
Top = 2910
Width = 2175
End
Begin CheckBox TileChecked
Caption = "Tile"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 75
TabIndex = 12
Top = 3630
Value = 1 'Checked
Width = 735
End
Begin PictureBox Picture2
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 450
Left = 1440
ScaleHeight = 28
ScaleMode = 3 'Pixel
ScaleWidth = 33
TabIndex = 11
Top = 4200
Width = 525
End
Begin CheckBox ResizableChecked
Caption = "Resizable"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 240
Left = 2400
TabIndex = 10
Top = 4320
Value = 1 'Checked
Width = 1485
End
Begin Timer Timer1
Left = 930
Top = 5925
End
Begin PictureBox Picture1
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 450
Left = 240
ScaleHeight = 30
ScaleMode = 3 'Pixel
ScaleWidth = 35
TabIndex = 4
Top = 4200
Width = 525
End
Begin FileListBox File2
Height = 810
Left = 2475
Pattern = "*.bmp;*.ico;*.wmf;*.rle;*.dib"
TabIndex = 7
Top = 4755
Width = 1845
End
Begin DirListBox Dir2
Height = 900
Left = 60
TabIndex = 6
Top = 4755
Width = 2280
End
Begin CommandButton Command1
Caption = "Set as Wallpaper"
Default = -1 'True
Height = 315
Left = 75
TabIndex = 9
Top = 3240
Width = 4275
End
Begin CommandButton Command2
Caption = "Refresh List"
Enabled = 0 'False
Height = 315
Left = 2430
TabIndex = 3
Top = 2880
Visible = 0 'False
Width = 1920
End
Begin DirListBox Dir1
ForeColor = &H00000000&
Height = 2280
Left = 75
TabIndex = 0
Top = 555
Width = 2295
End
Begin ListBox List1
Enabled = 0 'False
Height = 2760
Left = 2445
Sorted = -1 'True
TabIndex = 5
Top = 75
Visible = 0 'False
Width = 1905
End
Begin FileListBox File1
Height = 2760
Left = 2445
Pattern = "*.bmp;*.ico;*.wmf;*.rle;*.dib"
TabIndex = 1
Top = 75
Width = 1905
End
Begin DriveListBox Drive1
Height = 315
Left = 75
TabIndex = 2
Top = 75
Width = 2295
End
Begin Label Label1
Alignment = 1 'Right Justify
Height = 240
Left = 2970
TabIndex = 8
Top = 2940
Visible = 0 'False
Width = 1335
End
Begin Menu FileMenu
Caption = "File"
Begin Menu FileExit
Caption = "E&xit"
End
Begin Menu FileSep
Caption = "-"
End
Begin Menu FileAbout
Caption = "&About WallPeeper..."
End
End
End
DefInt A-Z
Declare Function GetVersion Lib "Kernel" () As Long
Declare Function GetWindowsDirectory Lib "kernel" (ByVal P$, ByVal S)
Declare Sub SystemParametersInfo Lib "User" (ByVal wAction%, ByVal wParam%, lParam As Any, ByVal fWinIni%)
Declare Function WriteProfileString% Lib "Kernel" (ByVal lpAppName$, ByVal lpKeyName$, ByVal lpString$)
Const SPI_SETDESKWALLPAPER = 20
Const SPIF_UPDATEINIFILE = 1 'update Win.ini Const
Const SPIF_SENDWININICHANGE = 2 'update Win.ini and tell everyone
Sub Command1_Click ()
OldMouseP = Screen.MousePointer
Screen.MousePointer = 11
Dim WinPath As String
BmpFile$ = "WALLPEEP.BMP"
WinPath = String$(145, Chr$(0))
T% = GetWindowsDirectory(WinPath, Len(WinPath))
WinPath = Left$(WinPath, T%)
Call DragPictureTo((Form2.DestinationPic.Width), (Form2.DestinationPic.Height), False)
Form1.Picture2.Picture = Form2.DestinationPic.Image
Call DottedLine
Form1.Picture2.Width = Form2.DestinationPic.Width
Form1.Picture2.Height = Form2.DestinationPic.Height
Form1.Picture2.ScaleWidth = Form2.DestinationPic.ScaleWidth
Form1.Picture2.ScaleHeight = Form2.DestinationPic.ScaleHeight
SavePicture Form1.Picture2.Image, WinPath + "\" + BmpFile$
'[Desktop]
'Pattern = (None)
'Wallpaper=C:\WINDOWS\WALLVIEW.BMP
'GridGranularity = 0
'IconSpacing = 93
'TileWallPaper = 1
If Form1.TileChecked.Value = 0 Then
T% = WriteProfileString%("Desktop", "TileWallPaper", "0")
Else
T% = WriteProfileString%("Desktop", "TileWallPaper", "1")
End If
SystemParametersInfo SPI_SETDESKWALLPAPER, 0, ByVal WinPath + "\" + BmpFile$, SPIF_UPDATEINIFILE
Screen.MousePointer = OldMouseP
End Sub
Sub Command2_Click ()
Command2.Enabled = False
OldMousePointer = Screen.MousePointer
Screen.MousePointer = 11
Call FillList
Screen.MousePointer = OldMousePointer
End Sub
Sub Dir1_Change ()
File1.Path = Dir1.Path
End Sub
Sub Dir1_Click ()
Dir1.Path = Dir1.List(Dir1.ListIndex)
End Sub
Sub Drive1_Change ()
On Error Resume Next
If SavedDrive$ = Drive1.Drive Then Exit Sub
Dir1.Path = Drive1.Drive
If Err <> 0 Then
On Error Resume Next
MsgBox "Error reading drive " + Drive1.Drive
Drive1.Drive = SavedDrive$
On Error Resume Next
Dir1.Path = Drive1.Drive
On Error GoTo 0
Exit Sub
End If
On Error GoTo 0
If (List1.ListCount > 0) And (SavedDrive$ <> Drive1.Drive) Then
ClearListBox Form1.List1
End If
SavedDrive$ = Drive1.Drive
T$ = ShowAllFiles.Caption
Mid$(T$, Len(T$), 1) = UCase$(Drive1.Drive)
ShowAllFiles.Caption = T$
If ShowAllFiles.Value = False Then
Else
OldMousePointer = Screen.Mo